package org.springblade.modules.admin.vo.platform;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @author zcc
 * @version 1.0
 * @date 2022/5/31 16:17
 */
@Data
public class ApplicationElevatorDetailVo {

	private Long id;

	private String tenantId;

	private Long formId;

	private Long buildingId;

	private String buildingName;

	private Long elevatorId;

	private String elevatorAddress;

	private int status;

	private String statusName;

	private Date updateTime;

	private String updateUserName;

	/**
	 * 维保业务生效状态 0-未开通, 1-待生效, 2-生效中, 3-已失效
	 */
	@ApiModelProperty(value = "维保业务生效状态 0-未开通, 1-待生效, 2-生效中, 3-已失效")
	private Integer maintainStatus;


	/**
	 * 维保业务生效开始时间
	 */
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
	@ApiModelProperty(value = "维保业务生效开始时间")
	private Date maintainStartTime;

	/**
	 * 维保业务生效结束时间
	 */
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
	@ApiModelProperty(value = "维保业务生效结束时间")
	private Date maintainEndTime;

	/**
	 * 维保业务生效人id
	 */
	@ApiModelProperty(value = "维保业务生效人id")
	private Long maintainOperatorId;

	/**
	 * 维保业务生效人名称
	 */
	@ApiModelProperty(value = "维保业务生效人名称")
	private String maintainOperatorName;


	/**
	 * 维保业务生效时间
	 */
	@ApiModelProperty(value = "维保业务生效时间")
	private Date maintainOperateTime;

	/**
	 * 梯联网生效状态 0-未开通, 1-待生效, 2-生效中, 3-已失效
	 */
	@ApiModelProperty(value = "梯联网生效状态 0-未开通, 1-待生效, 2-生效中, 3-已失效")
	private Integer tlwStatus;

	/**
	 * 梯联网生效开始时间
	 */
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
	@ApiModelProperty(value = "梯联网生效开始时间")
	private Date tlwStartTime;

	/**
	 * 梯联网生效结束时间
	 */
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATE)
	@JsonFormat(pattern = DateUtil.PATTERN_DATE)
	@ApiModelProperty(value = "梯联网生效结束时间")
	private Date tlwEndTime;

	/**
	 * 梯联网生效人id
	 */
	@ApiModelProperty(value = "梯联网生效人id")
	private Long tlwOperatorId;

	/**
	 * 梯联网生效人名称
	 */
	@ApiModelProperty(value = "梯联网生效人名称")
	private String tlwOperatorName;

	/**
	 * 梯联网生效时间
	 */
	@ApiModelProperty(value = "梯联网生效时间")
	private Date tlwOperateTime;


	public void setStatus(int status) {
		this.status = status;
		int[] statuss = {0, 1, 2, 3};
		if (status == statuss[1]) {
			this.statusName = "待审核";
		}else if (status == statuss[2]) {
			this.statusName = "审核通过";
		}else if (status == statuss[3]) {
			this.statusName = "审核不通过";
		}
	}
}
